perm filename MANUAL.TEX[MF,DEK]14 blob sn#765802 filedate 1984-08-24 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00011 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	% This manual is copyright (C) 1984 by the American Mathematical Society.
C00004 00003	% halftitle
C00006 00004	% title
C00008 00005	% copyright
C00011 00006	% dedication
C00012 00007	% blank page
C00013 00008	% the preface
C00048 00009	% the table of contents
C00052 00010	\beginchapter Chapter 1. The Name of\\the Game
C00055 00011	\end
C00057 ENDMK
C⊗;
% This manual is copyright (C) 1984 by the American Mathematical Society.
% All rights are reserved!
% The file is distributed only for people to see its examples of TeX input,
% not for use in the preparation of books like The METAFONTbook.
% Permission for any other use of this file must be obtained in writing
% from the copyright holder and also from the publisher (Addison-Wesley).
%\loop\iftrue
%  \errmessage{This manual is copyrighted and should not be TeXed}\repeat
%\pausing1 \input manmac
%\ifproofmode\message{Proof mode is on!}\pausing1\fi
\input manmac[tex,dek]
\font\biglogo=manfnt scaled \magstep3
\def\!{\kern-.05em\relax}
% halftitle
\titlepage
\pageno=-1984
\line{\titlefont The {\biglogo ()*+,-.*}book}
\vfill
\ifproofmode
\rightline{The fine print in the upper right-hand}
\rightline{corner of each page is a draft of intended}
\rightline{index entries; it won't appear in the real book.}
\rightline{Some index entries will be in |typewriter type|}
\rightline{and/or enclosed in \<$\ldots$>, etc;}
\rightline{such typographic distinctions aren't shown here.}
\rightline{An index entry often extends for several pages;}
\rightline{the actual scope will be determined later.}
\rightline{Please note things that should be indexed but aren't.}
\fi
\eject
% title
\pageno=-1 % the front matter is numbered with roman numerals
\font\auth=amssmc10 scaled\magstep4 % used only on the title page
\font\elevenbf=ambx10 scaled\magstephalf % ditto
\font\elevenit=amti10 scaled\magstephalf % ditto
\font\elevenrm=amr10 scaled\magstephalf % ditto
\titlepage
\line{\titlefont The {\biglogo ()*+,-.*}book}
↑↑{Knuth, Donald Ervin}
↑↑{Bibby, Duane Robert}
\vskip 1pc
\baselineskip 13pt \elevenbf
\halign to\hsize{#\hfil\tabskip 0pt plus 1fil&#\hfil\tabskip0pt\cr
\kern1.5mm\auth DONALD \kern+2pt E. \kern+2pt KNUTH&
  \elevenit Stanford University\cr
\noalign{\vskip 12pc}
&\elevenit I\kern.7ptllustrations by\cr
&DUANE BIBBY\cr
\noalign{\vfill}
&\setbox0=\hbox{\manual\char'44\char'44}%
\setbox2=\hbox to\wd0{\hss\manual\char'43\hss}%
\raise2.3mm\box2\kern-\wd0\box0\cr % A-W logo
&ADDISON-\kern-1pt WESLEY\cr
&PUBLISHING COMP\kern-.13emANY\kern-1.5mm\cr
\noalign{\vskip.5pc \global\elevenrm}
&Reading, Massachusetts\cr
&Menlo Park, California\cr
&London\enspace$\cdot$\enspace Amsterdam\cr
&Don Mills, Ontario\enspace$\cdot$\enspace Sydney\cr}
\eject
% copyright
\titlepage
\eightpoint
\vbox to 8pc{}
\noindent\strut
The quotation on page xxx is copyright $\copyright$ 19xx by Xxxx,
and used by permission.
\medskip
\noindent
\TeX\ is a trademark of the American Mathematical Society.
\bigskip\medskip
\noindent
{\bf Library of Congress cataloging in publication data}
\medskip
{\tt\halign{#\hfil\cr
Knuth, Donald Ervin (1938-\cr
\ \ \  The METAFONTbook.\cr
\noalign{\medskip}
\ \ \  Includes index.\cr
\ \ \  1.~METAFONT (Computer system).\ \ 2.~Computerized\cr
typesetting.\ \ 3.~Typeface design.\ \ I.~Title.\cr
Z253.4.T47K58\ \ 1985\ \ \ \ \ \ \ \ \ 686.2\char13 xxxx\ \ \ \ \ \ 84-xxx\cr
ISBN 0-201-xxxxx-x\cr}}
\vfill
%\noindent
%{\sl \kern-1pt Second printing, Someday?}
%\smallskip
\noindent
Copyright $\copyright$ 1985 by the American Mathematical Society
\smallskip
\noindent
This book is published jointly by the American Mathematical Society
and Addison-\kern-1ptWesley Publishing Company.
All rights reserved. No part of this publication may be reproduced, stored in
a retrieval system, or transmitted, in any form or by any means,
electronic, mechanical, photocopying, recording, or otherwise, without
the prior written permission of the publishers. Printed in the United
States of America. Published simultaneously in Canada.
\medskip
\noindent
ISBN 0-201-xxxxx-x\par
\noindent
ABCDEFGHIJ--HA--89876543
↑↑{Knuth, Donald Ervin}
\eject
% dedication
\titlepage
\vbox to 8pc{}
\rightline{\strut\eightssi To Hermann Zapf}
↑↑{Zapf, Hermann}
\vskip2pt
\rightline{\eightssi Whose strokes are the best}
\vfill
\eject
% blank page
\titlepage
\null\vfill
\eject
% the preface
\titlepage
\def\rhead{Preface}
\vbox to 8pc{
\rightline{\titlefont Preface}\vss}
{\topskip 9pc % this makes equal sinkage throughout the Preface
\vskip-\parskip
\tenpoint
\noindent\hang\hangafter-2
\hbox to 0pt{\hskip-\hangindent\manual\char'176\hfill}\hskip-16pt
{\sc ENERATION} {\sc OF} {\sc TYPEFACES} \strut by mathematical means
was first tried in the fifteenth century; it became popular in the
sixteenth and seventeenth centuries; and it was abandoned (for good
reasons) during the eighteenth century. Perhaps the twentieth century
will turn out to be the right time for this idea to make a comeback,
now that mathematics has advanced and computers are able to
do the calculations.

Modern printing equipment based on raster lines---in which metal ``type''
has been replaced by purely combinatorial patterns of zeroes and ones
that specify the desired position of ink in a discrete way---makes
mathematics and computer science increasingly relevant to printing.
We now have the ability to give a completely precise definition of letter
shapes that will produce essentially equivalent results on all raster-based
machines. Furthermore it is possible to include variable parameters in the
definitions of those shapes; computers can ``draw'' new fonts of characters
in seconds, so that a designer is now able to perform valuable experiments
that were previously unthinkable.

\MF\ is a system for the design of alphabets suited to raster-based
devices that print or display text. The characters that you are reading
were all designed with \MF\!, in a completely precise way; and they
were developed rather hastily by the author of the system, who is a rank
amateur at such things. It seems clear that further work with \MF\ has
the potential of producing typefaces of real ↑{beauty}, so this manual has
been written for people who would like to help advance the art of
mathematical type design.

A top-notch designer of types needs to have an unusually good eye
and a highly developed sensitivity to the nuances of shapes.
A top-notch user of computer languages needs to have an unusual
talent for abstract reasoning and a highly-developed ability to
express intuitive ideas in formal terms. Very few people have both
of these unusual combinations of skills; hence the best products of
\MF\ will probably be collaborative efforts between between two
people who complement each other's abilities. Indeed, this situation
isn't very different from the way types have been created for hundreds
of years, except that the r\↑ole of ``punch cutter'' is now being
played by computer specialists instead of by metalsmiths.

A \MF\ user writes a ``program'' for each letter or symbol that is
desired. These programs are different from ordinary computer programs,
because they are essentially {\sl declarative\/} rather than imperative.
In the \MF\ language you explain where the major components of a
desired shape are to be located, and how they relate to each other,
but you don't have to work out the details of exactly where the lines
cross, etc.; the computer takes over the work of solving equations as it
deduces the consequences of your specifications. One of the advantages of
\MF\ is that it provides a discipline according to which the principles
of a particular alphabet design can be stated precisely---the underlying
intelligence does not remain hidden in the mind of the designer, it is
spelled out in the programs. Thus it is comparatively easy to obtain
consistency where consistency is desirable, and to extend a font to
new symbols that are compatible with the existing ones.

It would be nice if a system like \MF\ were to simplify the task of
type design to the point where beautiful new alphabets could be
created in a few hours. This, alas, is impossible; an enormous
amount of subtlety lies behind the seemingly simple letter shapes that
we see every day, and the designers of high-quality typefaces have
done their work so well that we don't notice the underlying complexity.
One of the disadvantages of \MF\ is that a person can easily use it
to produce poor alphabets, cheaply and in great quantity. Let us hope
that such experiments will have educational value as they reveal why the
subtle tricks of the trade are important, but that they will not cause
bad workmanship to proliferate. Anybody can now produce a book in which
all of the type is home-made, but a person or team of persons should
expect to spend a year or more on the project if the type is actually
supposed to look right. \MF\ won't put today's type designers out of work;
on the contrary, it will tend to make them heroes, as more and more people
come to appreciate their skills.

Although there is no royal road to type design, there are some things that
can, in fact, be done well with \MF\ in an afternoon. Geometric designs
are rather easy; and it doesn't take long to make modifications to letters
or symbols that have previously been expressed in \MF\ form. Thus,
although comparatively few users of \MF\ will have the courage to do an
entire alphabet from scratch, there will be many who will enjoy
customizing someone else's design.

This book is not a text about mathematics or about computers. But if
you know the rudiments of those subjects (namely, contemporary high school
mathematics, together with the knowledge of how to use the text
editing or word processing facilities on your computing machine),
you should be able to use \MF\ with little difficulty after reading
what follows. Some parts of the exposition in the text are more obscure than others,
however, since the author has tried to satisfy experienced \MF\!ers
as well as beginners and casual users with a single manual. Therefore
a special symbol has been used to warn about esoterica: When you see the sign
$$\vbox{\hbox{\dbend}\vskip 11pt}$$
at the beginning of a paragraph, watch out for a ``↑{dangerous bend}''
in the train of thought---don't read such a paragraph unless you need to.
You will be able to use \MF\ reasonably well, even to design characters like
the dangerous-bend symbol itself, without reading the fine print in such
advanced sections.

Some of the paragraphs in this manual are so far out that they are rated
$$\vcenter{\hbox{\dbend\kern1pt\dbend}\vskip 11pt}\;;$$
everything that was said about single dangerous-bend signs goes double
for these. You should probably have at least a month's experience with
\MF\ before you attempt to fathom such doubly dangerous depths
of the system; in fact, most people will never need to know \MF\
in this much detail, even if they use it every day. After all, it's
possible to fry an egg without knowing anything about biochemistry.
Yet the whole story is here in case you're curious. \ (About \MF, not eggs.)

The reason for such different levels of complexity is that people change
as they grow accustomed to any powerful tool. When you first try to use
\MF\!, you'll find that some parts of it are very easy, while other things
will take some getting used to. At first you'll probably try to control
the shapes too rigidly, by overspecifying data that has been copied from
some other medium.  But later, after you have begun to get a feeling for
what the machine can do well, you'll be a different person, and you'll be
willing to let \MF\ help contribute to your designs as they are being
developed. As you gain more and more experience working with this unusual
apprentice, your perspective will continue to change and you will be
running into different sorts of challenges.  That's the way it is with any
powerful tool: There's always more to learn, and there are always better
ways to do what you've done before.  At every stage in the development
you'll want a slightly different sort of manual.  You may even want to
write one yourself.  By paying attention to the dangerous bend signs in
this book you'll be better able to focus on the level that interests you
at a particular time.

Computer system manuals usually make dull reading, but take heart:
This one contains {\sc ↑{JOKES}} every once in a while. You might actually
enjoy reading it. \ (However, most of the jokes can only be appreciated
properly if you understand a technical point that is being made---so
read {\sl carefully}.)

Another noteworthy characteristic of this book is that it doesn't
always tell the ↑{truth}. When certain concepts of \MF\ are introduced
informally, general rules will be stated; afterwards you will find that the
rules aren't strictly true. In general, the later chapters contain more
reliable information than the earlier ones do. The author feels that this
technique of deliberate lying will actually make it easier for you to
learn the ideas. Once you understand a simple but false rule, it will not
be hard to supplement that rule with its exceptions.

In order to help you internalize what you're reading,
{\sc ↑{EXERCISES}} are sprinkled through this manual. It is generally intended
that every reader should try every exercise, except for questions that appear
in the ``dangerous bend'' areas. If you can't solve a problem, you
can always look up the answer.
But please, try first to solve it by yourself; then you'll learn more
and you'll learn faster. Furthermore, if you think you do know the solution,
you should turn to Appendix~A and check it out, just to make sure.

The \MF\ language described here has very little in common with the
author's previous attempt at a language for alphabet design, because
five years of experience with the old system has made it clear that a
completely different approach is preferable. Both languages have
been called \MF; but henceforth the old language should be called
\MF\kern.05em79, and its use should rapidly fade away. Let's keep the name \MF\
for the language described here, since it is so much better, and since
it will never change again. ↑↑{MF79}

\medskip
\hrule
\line{\vrule\hss\vbox{\medskip
\leftskip=\parindent \rightskip=\parindent
\strut W{\sc ARNING}: Font design can be hazardous to your other interests.
Once you get hooked, you will develop intense feelings about typography;
the medium will intrude on the messages that you read. And you will perpetually
be thinking of improvements to the fonts that you see everywhere,
especially those of your own design.
\strut\medskip}\hss\vrule}
\hrule

\medskip

I wish to thank the hundreds of people who have helped me to formulate
this ``definitive edition'' of \MF\!, based on their experiences with
preliminary versions of the system.  In particular, John ↑{Hobby}
discovered many of the algorithms that have made the new language
possible. My work at Stanford has been generously supported by the
↑{National Science Foundation}, the ↑{Office of Naval Research}, the ↑{IBM
Corporation}, and the ↑{System Development Foundation}. I also wish to
thank the ↑{American Mathematical Society} for its encouragement and for
publishing the {\sl ↑{TUGboat}\/} newsletter (see Appendix~J).
Above all, I deeply thank my wife, Jill, for the inspiration, ↑↑{Knuth, Jill}
understanding, comfort, and support she has given me for more than
25~years, especially during the eight years that I have been
working intensively on mathematical typography.

\medskip
\line{{\sl Stanford, California}\hfil--- D. E. K.}↑↑{Knuth, Don}
\line{\sl June 1984\hfil}

} % end of the special \topskip
\endchapter

It is hoped that Divine Justice may find
some suitable affliction for the malefactors
who invent variations upon the alphabet of our fathers.\thinspace.\thinspace.
The type-founder, worthy mechanic, has asserted himself
with an overshadowing individuality,
defacing with his monstrous creations and revivals
every publication in the land.
--AMBROSE ↑{BIERCE} {\sl The Opinionator. Alphab\↑etes\/}
  (1911) % vol 10 of his collected works, p69
  % probably written originally in 1898 or 1899

\bigskip

Can the new process yield a result that, say,
a Club of Bibliophiles would recognise
as a work of art comparable to
the choice books they have in their cabinets?
--STANLEY ↑{MORISON}, {\sl Typographic Design in Relation to
	Photographic Composition\/} (1958) % pp 4--5

\eject
% the table of contents
\titlepage
\vbox to 8pc{
\rightline{\titlefont Contents}
\vfill}
↑↑{Contents of this manual, table}
\def\rhead{Contents}
\tenpoint
\begingroup
\countdef\counter=255
\def\diamondleaders{\global\advance\counter by 1
  \ifodd\counter \kern-10pt \fi
  \leaders\hbox to 20pt{\ifodd\counter \kern13pt \else\kern3pt \fi
    .\hss}}
\baselineskip 15pt plus 5pt
\def\\#1. #2. #3.{\line{\strut
    \hbox to\parindent{\bf\hbox to 1em{\hss#1}\hss}%
    \rm#2\diamondleaders\hfil\hbox to 2em{\hss#3}}}
\\1. The Name of the Game. 1.
\\2. Whatever. 3.
\\3. Thirdly. 7.
\\4. Fourthly. 13.
\\5. Fifthly. 19.
\\6. Running \MF. 23.
\\7. How \MF\ Reads What You Type. 37.
\\8. XXX. 43.
\\9. All These Titles are Garbage. 51.
\\10. Dimensions. 57.
\\11. Boxes. 63.
\\12. Glue. 69.
\\13. Modes. 85.
\\14. How \TeX\ Breaks Paragraphs into Lines. 91.
\\15. How \TeX\ Makes Lines into Pages. 109.
\\16. Typing Math Formulas. 127.
\\17. More about Math. 139.
\\18. Fine Points of Mathematics Typing. 161.
\\19. Displayed Equations. 185.
\\20. Definitions (also called Macros). 199.
\\21. Making Boxes. 221.
\\22. Alignment. 231.
\\23. Output Routines. 251.
\eject
\vbox to 8pc{}
\\24. Summary of Normal Mode. 267.
\\25. Summary of Abnormal Mode. 285.
\\26. Summary of Everything Else. 287.
\\27. Recovering from Errors. 289.
\null
\leftline{\indent\bf Appendices}
\\A. Answers to All the Exercises. 305.
\\B. Basic Control Sequences. 339.
\\C. Character Codes. 367.
\\D. Dirty Tricks. 373.
\\E. Example Formats. 403.
\\F. Font Tables. 427.
\\G. Generating Boxes from Formulas. 441.
\\H. Hyphenation. 449.
\\I\hskip 1pt. Index. 457.
\\J. Joining the \TeX\ Community. 483.
\null % 17 lines so far to balance the 23 on the other page
\null % 18
\null % 19
\null % 20
\null % 21
\null % 22
\null % 23
\eject
\endgroup
\beginchapter Chapter 1. The Name of\\the Game

\pageno=1 % This is page number 1, number 1,
This is a book about \MF\!, just as {\sl The \TeX book\/} is about \TeX.
\MF\ and \TeX\ are good friends who intend to live together for a long time.
Between them they take care of the two most fundamental tasks of typesetting:
\TeX\ puts characters into the proper positions on a page, while \MF\
determines the shapes of the characters themselves.

Why is the system called \MF? The `-{\manual FONT}' part is easy to understand,
because sets of related chaacters that are used in typesetting are traditionally
known as fonts of type. The `{\manual META}-' part is more interesting: It
mumble blah blah.

The rest of this chapter hasn't been written yet, as you can see.

\endchapter

[Tinguely] made some large, brightly coloured open reliefs,
juxtaposing stationary and mobile shapes.
He later gave them names like
{\rm Meta-↑{Kandinsky}}\kern-1pt and\/ {\rm Meta-↑{Herbin}},
to clarify the ideas and attitudes
that lay at the root of their conception.
--K. G. PONTUS ↑{HULT\'EN}, {\sl Jean ↑{Tinguely}: M\'eta\/} (1972)
 % translated from German by Mary Whittall, 1975, p46

\bigskip

A second quotation.
\author A SECOND AUTHOR, {\sl  Source\/} (1988)

\eject
\end